/*
* DewPointService.java
* Created on  202015/6/15 17:09
* 版本       修改时间          作者      修改内容
* V1.0.1    202015/6/15       longshihui    初始版本
*
*/

package com.infitecs.eyas.combustion.service;

import com.infitecs.eyas.combustion.dao.DewPointDao;
import com.infitecs.eyas.combustion.model.CalculateDewPoint;
import com.infitecs.eyas.constant.Constant;
import com.infitecs.eyas.session.SessionService;
import com.infitecs.eyas.step.modal.StepInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 类的描述信息
 *
 * @author longshihui
 * @version 1.0.1
 */
@Service
public class DewPointService {
    @Autowired
    private DewPointDao dewPointDao;

    @Autowired
    private SessionService sessionService;

    public CalculateDewPoint getCalculateDewPoint() {
        return dewPointDao.getCalculateDewPoint(sessionService.getCaseId());
    }

    public void addCalculateDewPoint() {
        int caseId = sessionService.getCaseId();
        dewPointDao.addCalculateDewPoint(caseId);
        sessionService.addStepState(new StepInfo(caseId, Constant.STEP_ID_9, Constant.STEP_OVER_STATE_0));
    }

    public void saveValueOfDewPoint(CalculateDewPoint calculateDewPoint) {
        calculateDewPoint.setCaseId(sessionService.getCaseId());
        dewPointDao.saveValueOfDewPoint(calculateDewPoint);
        calculateDewPoint.setParamName(sessionService.getE() + calculateDewPoint.getParamName());
        sessionService.putParamMap(calculateDewPoint);
    }

    public void saveVo(CalculateDewPoint calculateDewPoint) {
        calculateDewPoint.setCaseId(sessionService.getCaseId());
        dewPointDao.saveVo(calculateDewPoint);
    }


}
